package com.zf.apartment.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zf.apartment.mapper.ImageMapper;
import com.zf.apartment.domain.Image;
import com.zf.apartment.service.IImageService;

/**
 * 图片Service业务层处理
 *
 * @author rxf
 * @date 2024-10-05
 */
@Service
public class ImageServiceImpl extends ServiceImpl<ImageMapper, Image> implements IImageService {
    @Autowired
    private ImageMapper imageMapper;

    /**
     * 查询图片
     *
     * @param imageId 图片主键
     * @return 图片
     */
    @Override
    public Image selectImageByImageId(Long imageId) {
        return imageMapper.selectImageByImageId(imageId);
    }

    /**
     * 查询图片列表
     *
     * @param image 图片
     * @return 图片
     */
    @Override
    public List<Image> selectImageList(Image image) {
        return imageMapper.selectImageList(image);
    }

    /**
     * 新增图片
     *
     * @param image 图片
     * @return 结果
     */
    @Override
    public int insertImage(Image image) {
            return imageMapper.insertImage(image);
    }

    /**
     * 修改图片
     *
     * @param image 图片
     * @return 结果
     */
    @Override
    public int updateImage(Image image) {
        return imageMapper.updateImage(image);
    }

    /**
     * 批量删除图片
     *
     * @param imageIds 需要删除的图片主键
     * @return 结果
     */
    @Override
    public int deleteImageByImageIds(Long[] imageIds) {
        return imageMapper.deleteImageByImageIds(imageIds);
    }

    /**
     * 删除图片信息
     *
     * @param imageId 图片主键
     * @return 结果
     */
    @Override
    public int deleteImageByImageId(Long imageId) {
        return imageMapper.deleteImageByImageId(imageId);
    }
}